<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
var str = 'abcdefg';
console.log(str.substring(1, 4)); 	//返回bcd
console.log(str.substring(1));  	//返回bcdefg
console.log(str.substring(-1)); 	//返回abcdefg，传入负值时会视为0

  </script>
 </body>
</html>
